package com.zlcx.tz.live.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @AUTHOR xhl
 * @CREATE 2019-04-18 10:53
 **/
@Data
@ApiModel("房间信息")
public class RoomInfoVO {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "直播channelName")
    private String ChannelId;

    @ApiModelProperty(value = "房间名称")
    private String roomName;

    @ApiModelProperty(value = "房间介绍")
    private String roomDesc;

    @ApiModelProperty(value = "最大上麦人数")
    private Integer roomPublisherMax;

    @ApiModelProperty(value = "房间状态")
    private Integer roomState;

    @ApiModelProperty(value = "房间禁麦状态 0-禁麦，1-不禁麦")
    private Integer roomMicState;

    @ApiModelProperty(value = "当前连麦人数")
    private Integer publisherNumber;

    @ApiModelProperty(value = "当前观众人数")
    private Integer audienceNumber;

    @ApiModelProperty(value = "房间图片地址")
    private String roomAvatar;

    @ApiModelProperty(value = "连麦用户")
    private List<UserJoinVO> publishers;

    @ApiModelProperty(value = "观众")
    private List<UserJoinVO> audiences;

    @ApiModelProperty(value = "房主用户id")
    private Long ownerUserId;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "之前是否已经在房间中 0-不在，1-在")
    private Integer beforeJoinStatus = 0;

    @ApiModelProperty(value = "用户角色：0-房主，1-主播，2-观众，3-游客")
    private Integer userRole;

    @ApiModelProperty(value = "声网角色：1-主播，2-观众")
    private Integer clientRole;


    @ApiModelProperty(value = "只接受VIP用户上麦申请, 1是， 0否")
    private Integer onlyVipApply;

    @ApiModelProperty(value = "房主的学习内容")
    private String ownerStudyContent;

    @ApiModelProperty(value = "鉴黄频率，单位秒")
    private Integer checkRate;

    //不能删除，隐式调用了此方法赋值
    public Integer getClientRole() {
        return userRole == null ? 2 : userRole == 2 || userRole == 3 ? 2 : 1;
    }
}
